﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BusinessLayer;

namespace DeAn_LapTrinhCSDL.Report
{
    public partial class rpVatTu : DevExpress.XtraReports.UI.XtraReport
    {
        string currentDirectory = System.IO.Directory.GetParent(System.IO.Directory.GetCurrentDirectory()).Parent.FullName;
        public string headerText;
        XuLy xl;
        public rpVatTu()
        {
            InitializeComponent();
            xl = new XuLy();
            xl.connect.ConnectionString = Program.strConnect;
        }

        private void xrPictureBox1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            xrPictureBox1.ImageUrl = currentDirectory + "\\Images\\" + GetCurrentColumnValue("HINH");// @"E:\Hung\Lien thong\lap trinh csdl\Source\DeAn_LapTrinhCSDL\Images\Koala.jpg";
        }

        private void xrLabel12_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            xrLabel12.Text = xl.ConvertToVietnameseDateTime(DateTime.Now);
        }

        private void xrLabel1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            if (string.IsNullOrEmpty(headerText))
                xrLabel1.Text = "DANH MỤC VẬT TƯ";
            else
                xrLabel1.Text = headerText;
        }

    }
}
